package com.py.credit.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.ModelDetail;
import com.py.credit.entity.ModelTestChartPoint;
import com.py.credit.entity.ModelTestPc;
import com.py.credit.entity.ModelTestRankForPiePoint;
import com.py.credit.entity.ModelTestScoreForBarPoint;
import com.py.framework.core.common.Page;

public interface ModelTestDao {
	/**
	 * 获取列表
	 * 
	 * @return
	 */
	public List<Map<String, Object>> selectByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page,
			@Param(value = "mainType") String mainType,
			@Param(value = "userId") String userId);

	/**
	 * 获取详情列表
	 * 
	 * @return
	 */
	public List<ModelDetail> selectPcDetailByConditionForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page,
			@Param(value = "pcId") String pcId);

	public void addPc(@Param(value = "modelTestPc") ModelTestPc modelTestPc);

	public void updatePcExecuteTime(@Param(value = "duringTime") String duringTime, @Param(value = "id") String id);
	
	public void updatePcProcess(@Param(value = "process") int process,@Param(value = "countAll") long countAll, @Param(value = "id") String id);

	public void initPcDetailByEvalInfo(@Param(value = "pcId") String pcId, @Param(value = "modelId") String modelId,
			@Param(value = "listTybm") List<String> listTybm);

	public List<ModelTestChartPoint> toNormalDistributionChart(@Param(value = "pcId") String pcId,
			@Param(value = "rate") String rate);

	public List<ModelTestRankForPiePoint> toRankForPieChart(@Param(value = "pcId") String pcId);

	public List<ModelTestScoreForBarPoint> toScoreForBarChart(@Param(value = "pcId") String pcId);

	public List<Map<String, String>> selectSqlIndexesByModel(@Param(value = "modelId") String modelId);

	public List<Map<String, String>> selectFinanceIndexesByModel(@Param(value = "modelId") String modelId);

	public List<Map<String, String>> selectZzIndexesByModel(@Param(value = "modelId") String modelId);

	public void autoScoreByIndexSql(@Param(value = "sql") String sql, @Param(value = "listAll") List<Map> listAll);

	public void initIndexInfo(@Param(value = "pcId") String pcId,
			@Param(value = "indexCatModelId") String indexCatModelId, @Param(value = "list") List<Map> list);

	/*
	 * public void insertPcDetail(@Param(value = "pcId") String
	 * pcId,@Param(value = "initIndexScore") double initIndexScore,@Param(value
	 * = "leftWeight") double leftWeight);
	 */

	public void initPcDetailByModelTest(@Param(value = "pcId") String pcId, @Param(value = "list") List<Map> list);

	public void deleForUserReport(@Param(value = "pcId") String pcId);

	public void updatePcDetailForScore(@Param(value = "pcId") String pcId,
			@Param(value = "initIndexScore") double initIndexScore, @Param(value = "leftWeight") double leftWeight);

	public void updatePcDetailRank(@Param(value = "pcId") String pcId, @Param(value = "modelId") String modelId);

	public void updateIndexScore(@Param(value = "pcId") String pcId,
			@Param(value = "indexCatModelId") String indexCatModelId, @Param(value = "weight") double weight);

	public void updateIndexScoreForDict(@Param(value = "pcId") String pcId,
			@Param(value = "indexCatModelId") String indexCatModelId, @Param(value = "weight") double weight);

	public Map<String, String> getParentWeight(@Param(value = "modelId") String modelId, @Param(value = "id") String id,
			@Param(value = "type") String type);

	public String selectModelIdByMainType(@Param(value = "mainType") String mainType);

	public void updateBgbhByPc(@Param(value = "pcId") String pcId);

	public List<Map<String, String>> selectModel(@Param(value = "zone") String zone,
			@Param(value = "industry") String industry, @Param(value = "reportType") String reportType,
			@Param(value = "mainType") String mainType);

	public Map<String, String> selectScoreInfoByTybmAndPcid(@Param(value = "pcId") String pcId,
			@Param(value = "tybm") String tybm);

	public void insertBatchExport(@Param(value = "list") List<Map<String, Object>> list,
			@Param(value = "batchId") String batchId);

	public void updateBatchExportTrue(@Param(value = "batchId") String batchId);

	public void updateBatchExportFalse(@Param(value = "batchId") String batchId);

	public List<String> selectBatchExport(@Param(value = "mainType") String mainType,
			@Param(value = "batchId") String batchId);

	public List<Map<String, Object>> selectBatchExportForPage(@Param(value = "columns") List<String> columns,
			@Param(value = "additionalColumns") String[] additionalColumns,
			@Param(value = "conditions") List<String> conditions, @Param(value = "page") Page page,
			@Param(value = "batchId") String batchId);

	public int selectNoRepeatCount(@Param(value = "mainType") String mainType,
			@Param(value = "batchId") String batchId);

	public int selectRightAllCount(@Param(value = "mainType") String mainType,
			@Param(value = "batchId") String batchId);

	public int selectErrorCount(@Param(value = "mainType") String mainType, @Param(value = "batchId") String batchId);

	public int updateReportStatus(@Param(value = "status") String status, @Param(value = "id") String id);

	public Long insertCardsSfyzzAll(@Param(value = "params") Map<String, Object> params);

	public Long insertCardsZzsfdqAll(@Param(value = "params") Map<String, Object> params);

	public Long insertFinance(@Param(value = "params") Map<String, Object> params);

	public String getEvailInfoScore(@Param(value="tybm") String tybm);

	Map<String, Object> getScoreDetailByPC(@Param(value="pcId") String pcId);

	public  Map<String, Object> getxydjInfo(@Param(value="tybm")String tybm,@Param(value="pcId") String pcId);

	public String getpchByPcid(@Param(value="id")String id);
}